package com.shujuku.test2;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * 作者: LCG
 * 日期: 2020/3/19 22:31
 * 描述:
 */

@Mapper
public interface MyTestMapper {

    @Select("select * from tb_test where id <= #{id} FOR update")
    public List<Map<String,String>> getData1(String id);

    @Update("update tb_test set userName=#{userName} where id=#{id}")
    public int toUpdate(Map<String,String> map);

    @Select("select * from tb_test where id >= #{id} FOR update")
    public List<Map<String,String>> getData2(String id);



}
